import React from 'react';
import { Link, Route } from 'react-router-dom';
const home = props => {
  console.log(props);
  let { match } = props;
  const { path } = match;
  return (
    <div>
      <h1>我是首页</h1>
      <nav>
        <Link to={`${path}/left`}>左侧</Link>
        <Link to={`${path}/right`}>右侧</Link>
      </nav>
      <main>
        <Route path={`${path}/left`} component={() => <div>左侧</div>} />
        <Route path={`${path}/right`} component={() => <div>右侧</div>} />
      </main>
    </div>
  );
};

export default home;
